home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / catman / p_man / cat3 / qgridlayout.Z / qgridlayout
Encoding:
Text File  |  1998-10-28  |  19.7 KB  |  331 lines

  1.  
  2.  
  3.  
  4.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))   QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       QGridLayout -    The QVBoxLayout    class lays out child widgets
  10.       in a grid
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.       #include <qlayout.h>
  14.  
  15.       Inherits QLayout.
  16.  
  17.     PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrrssss
  18.       QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt ((((    QQQQWWWWiiiiddddggggeeeetttt    **** _p_a_r_e_n_t,,,, iiiinnnntttt _n_R_o_w_s,,,, iiiinnnntttt _n_C_o_l_s
  19.       QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt ((((    iiiinnnntttt _n_R_o_w_s,,,, iiiinnnntttt _n_C_o_l_s,,,, iiiinnnntttt _a_u_t_o_B_o_r_d_e_r
  20.       ~~~~QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt ()
  21.       vvvvooooiiiidddd aaaaddddddddWWWWiiiiddddggggeeeetttt (((( QQQQWWWWiiiiddddggggeeeetttt ****,,,, iiiinnnntttt _r_o_w,,,, iiiinnnntttt _c_o_l,,,,    iiiinnnntttt _a_l_i_g_n
  22.       vvvvooooiiiidddd aaaaddddddddMMMMuuuullllttttiiiiCCCCeeeellllllllWWWWiiiiddddggggeeeetttt (((( QQQQWWWWiiiiddddggggeeeetttt ****,,,, iiiinnnntttt _f_r_o_m_R_o_w,,,, iiiinnnntttt    _t_o_R_o_w,,,,
  23.           iiiinnnntttt _f_r_o_m_C_o_l
  24.       vvvvooooiiiidddd aaaaddddddddLLLLaaaayyyyoooouuuutttt (((( QQQQLLLLaaaayyyyoooouuuutttt **** _l_a_y_o_u_t,,,, iiiinnnntttt _r_o_w,,,, iiiinnnntttt ccccoooollll ))))
  25.       vvvvooooiiiidddd sssseeeettttRRRRoooowwwwSSSSttttrrrreeeettttcccchhhh (((( iiiinnnntttt _r_o_w,,,,    iiiinnnntttt ssssttttrrrreeeettttcccchhhh ))))
  26.       vvvvooooiiiidddd sssseeeettttCCCCoooollllSSSSttttrrrreeeettttcccchhhh (((( iiiinnnntttt _c_o_l,,,,    iiiinnnntttt ssssttttrrrreeeettttcccchhhh ))))
  27.       vvvvooooiiiidddd aaaaddddddddRRRRoooowwwwSSSSppppaaaacccciiiinnnngggg (((( iiiinnnntttt _r_o_w,,,,    iiiinnnntttt mmmmiiiinnnnssssiiiizzzzeeee ))))
  28.       vvvvooooiiiidddd aaaaddddddddCCCCoooollllSSSSppppaaaacccciiiinnnngggg (((( iiiinnnntttt _c_o_l,,,,    iiiinnnntttt mmmmiiiinnnnssssiiiizzzzeeee ))))
  29.       iiiinnnntttt nnnnuuuummmmRRRRoooowwwwssss (((()))) ccccoooonnnnsssstttt
  30.       iiiinnnntttt nnnnuuuummmmCCCCoooollllssss (((()))) ccccoooonnnnsssstttt
  31.       vvvvooooiiiidddd eeeexxxxppppaaaannnndddd ((((    iiiinnnntttt _r_o_w_s,,,, iiiinnnntttt ccccoooollllssss ))))
  32.  
  33.     PPPPrrrrooootttteeeecccctttteeeedddd MMMMeeeemmmmbbbbeeeerrrrssss
  34.       vvvviiiirrrrttttuuuuaaaallll QQQQCCCChhhhaaaaiiiinnnn**** mmmmaaaaiiiinnnnVVVVeeeerrrrttttiiiiccccaaaallllCCCChhhhaaaaiiiinnnn (((())))
  35.       vvvviiiirrrrttttuuuuaaaallll QQQQCCCChhhhaaaaiiiinnnn**** mmmmaaaaiiiinnnnHHHHoooorrrriiiizzzzoooonnnnttttaaaallllCCCChhhhaaaaiiiinnnn (((())))
  36.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd iiiinnnniiiittttGGGGMMMM (((())))
  37.  
  38.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  39.       The QVBoxLayout class    lays out child widgets in a grid.
  40.  
  41.       QGridLayout takes the    space it gets (from its    parent layout
  42.       or from the mainWidget()), divides it    up into    rows and
  43.       columns, and puts each of the    child widgets it manages into
  44.       the correct cell(s).
  45.  
  46.       Columns and rows behave identically; we will discuss columns
  47.       but there are    eqivalent functions for    rows.
  48.  
  49.       Each column has a minimum width and a    stretch    factor.    The
  50.       minimum width    is the greatest    of that    set using
  51.       addRowSpacing() and the minimum width    of each    widget in that
  52.       column. The stretch factor is    set using setColStretch() and
  53.       determines how much of the available space the column    will
  54.       get, over and    above its necessary minimum.
  55.  
  56.       Normally, each child widget or layout    is put into a cell of
  57.       its own using    addWidget() or addLayout(), but    you can    also
  58.       put widget into multiple cells using addMultiCellWidget().
  59.       However, if you do that, QGridLayout does not    take the child
  60.  
  61.  
  62.  
  63.      Page 1                         (printed 9/22/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))   QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))
  71.  
  72.  
  73.  
  74.       widget's minimum size    into consideration (because it does
  75.       not known what column    the minimum width should belong    to).
  76.       Thus you must    set the    minimum    width of each column using
  77.       addColSpacing().
  78.  
  79.       This illustration shows a fragment of    a dialog with a    five-
  80.       column, three-row grid (the grid is shown overlaid in
  81.       magenta):
  82.  
  83.                   [[[[IIIImmmmaaaaggggeeee OOOOmmmmiiiitttttttteeeedddd]]]]
  84.  
  85.       Columns 0, 2 and 4 in    this dialog fragment are made up of a
  86.       QLabel, a QLineEdit and a QListBox. Columns 1    and 2 are
  87.       placeholders,    made with setColSpacing(). Row 0 consists of
  88.       three    QLabel objects,    row 1 of three QLineEdit objects and
  89.       row 2    of three QListBox objects.
  90.  
  91.       Since    we did not want    any space between the rows, we had to
  92.       use placeholder columns to get the right amount of space
  93.       between the columns.
  94.  
  95.       Note that the    columns    and rows are not equally wide/tall: If
  96.       you want two columns to be equally wide, you must set    the
  97.       columns' minimum widths and stretch factors to be the    same
  98.       yourself. You    do this    using addColSpacing() and
  99.       setStretch().
  100.  
  101.       If the QGridLayout is    not the    top-level layout (ie. is not
  102.       managing all of the widget's area and    children), you must
  103.       add it to its    parent layout when you have created it,    but
  104.       before you can do anything with it. The normal way to    add a
  105.       layout is by calling parentLayout->addLayout().
  106.  
  107.       Once you have    done that, you can start putting widgets and
  108.       other    layouts    in the cells of    your grid layout using
  109.       addWidget(), addLayout() and addMultiCellWidget().
  110.  
  111.       Finally, if the grid is the top-level    layout,    you activate()
  112.       it.
  113.  
  114.       QGridLayout also includes two    margin widths: The border
  115.       width    and the    inter-box width. The border width is the width
  116.       of the reserved space    along each of the QGridLayout's    four
  117.       sides. The intra-widget width    is the width of    the
  118.       automatically    allocated spacing between neighbouring boxes.
  119.  
  120.       The border width defaults to 0, and the intra-widget width
  121.       defaults to the same as the border width. Both are set using
  122.       arguments to the constructor.
  123.  
  124.       Examples:  pref/pref.cpp layout/layout.cpp
  125.       widgets/widgets.cpp
  126.  
  127.  
  128.  
  129.      Page 2                         (printed 9/22/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))   QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))
  137.  
  138.  
  139.  
  140.      MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDOOOOCCCCUUUUMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  141.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt ((((    QQQQWWWWiiiiddddggggeeeetttt    **** ppppaaaarrrreeeennnntttt,,,, iiiinnnntttt nnnnRRRRoooowwwwssss,,,, iiiinnnntttt
  142.       nnnnCCCCoooollllssss,,,, iiiinnnntttt bbbboooorrrrddddeeeerrrr====0000,,,, iiiinnnntttt aaaauuuuttttooooBBBBoooorrrrddddeeeerrrr ====    ----1111,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****
  143.       nnnnaaaammmmeeee====0000 ))))
  144.       Constructs a new QGridLayout with _n_R_o_w_s rows,    _n_C_o_l_s columns
  145.       and main widget _p_a_r_e_n_t. _p_a_r_e_n_t may not be 0.
  146.  
  147.       _b_o_r_d_e_r is the    number of pixels between the edge of the
  148.       widget and the managed children. _a_u_t_o_B_o_r_d_e_r is the default
  149.       number of pixels between cells. If _a_u_t_o_B_o_r_d_e_r    is -1 the
  150.       value    of _b_o_r_d_e_r is used.
  151.  
  152.       _n_a_m_e is the internal object name.
  153.  
  154.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt ((((    iiiinnnntttt nnnnRRRRoooowwwwssss,,,, iiiinnnntttt nnnnCCCCoooollllssss,,,, iiiinnnntttt aaaauuuuttttooooBBBBoooorrrrddddeeeerrrr ====
  155.       ----1111,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr **** nnnnaaaammmmeeee====0000 ))))
  156.       Constructs a new grid    with _n_R_o_w_s rows    and _n_C_o_l_s columns, If
  157.       _a_u_t_o_B_o_r_d_e_r is    -1, this QGridLayout will inherits its
  158.       parent's defaultBorder(), otherwise _a_u_t_o_B_o_r_d_e_r is used.
  159.  
  160.       You have to insert this grid into another layout before
  161.       using    it.
  162.  
  163.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::~~~~QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt (((())))
  164.       Deletes this grid. Geometry management is terminated if this
  165.       is a top-level grid.
  166.  
  167.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::aaaaddddddddCCCCoooollllSSSSppppaaaacccciiiinnnngggg (((( iiiinnnntttt ccccoooollll,,,,    iiiinnnntttt mmmmiiiinnnnssssiiiizzzzeeee ))))
  168.       Sets the minimum width of _c_o_l    to _m_i_n_s_i_z_e pixels.
  169.  
  170.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::aaaaddddddddLLLLaaaayyyyoooouuuutttt (((( QQQQLLLLaaaayyyyoooouuuutttt **** llllaaaayyyyoooouuuutttt,,,, iiiinnnntttt rrrroooowwww,,,, iiiinnnntttt ccccoooollll
  171.       ))))
  172.       Places another layout    at position (_r_o_w, _c_o_l) in the grid.
  173.       The top left position    is (0,0).
  174.  
  175.       Examples:  widgets/widgets.cpp
  176.  
  177.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::aaaaddddddddMMMMuuuullllttttiiiiCCCCeeeellllllllWWWWiiiiddddggggeeeetttt (((( QQQQWWWWiiiiddddggggeeeetttt **** wwww,,,, iiiinnnntttt ffffrrrroooommmmRRRRoooowwww,,,,
  178.       iiiinnnntttt ttttooooRRRRoooowwww,,,, iiiinnnntttt ffffrrrroooommmmCCCCoooollll,,,, iiiinnnntttt ttttooooCCCCoooollll,,,, iiiinnnntttt aaaalllliiiiggggnnnn ==== 0000 ))))
  179.       Adds the widget _w to the cell    grid, spanning multiple
  180.       rows/columns.
  181.  
  182.       Note that multicell widgets do not influence the minimum or
  183.       maximum size of columns/rows they span. Use addColSpacing()
  184.       or addRowSpacing() to    set minimum sizes explicitly.
  185.  
  186.       Alignment is specified by _a_l_i_g_n which    takes the same
  187.       arguments as QLabel::setAlignment(), alignment has no    effect
  188.       unless you have set QWidget::maximumSize().
  189.  
  190.       Examples:  layout/layout.cpp widgets/widgets.cpp
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                         (printed 9/22/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))   QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))
  203.  
  204.  
  205.  
  206.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::aaaaddddddddRRRRoooowwwwSSSSppppaaaacccciiiinnnngggg (((( iiiinnnntttt rrrroooowwww,,,,    iiiinnnntttt mmmmiiiinnnnssssiiiizzzzeeee ))))
  207.       Sets the minimum height of _r_o_w to _m_i_n_s_i_z_e pixels.
  208.  
  209.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::aaaaddddddddWWWWiiiiddddggggeeeetttt (((( QQQQWWWWiiiiddddggggeeeetttt **** wwww,,,,    iiiinnnntttt rrrroooowwww,,,, iiiinnnntttt ccccoooollll,,,, iiiinnnntttt
  210.       aaaalllliiiiggggnnnn    ==== 0000 ))))
  211.       Adds the widget _w to the cell    grid at    _r_o_w, _c_o_l. The top left
  212.       position is (0,0)
  213.  
  214.       Alignment is specified by _a_l_i_g_n which    takes the same
  215.       arguments as QLabel::setAlignment(). Note that widgets take
  216.       all the space    they can get; alignment    has no effect unless
  217.       you have set QWidget::maximumSize().
  218.  
  219.       Examples:  pref/pref.cpp layout/layout.cpp
  220.       widgets/widgets.cpp
  221.  
  222.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::eeeexxxxppppaaaannnndddd ((((    iiiinnnntttt nnnnRRRRoooowwwwssss,,,, iiiinnnntttt nnnnCCCCoooollllssss ))))
  223.       Expands this grid so that it will have _n_R_o_w_s rows and    _n_C_o_l_s
  224.       columns. Will    not shrink the grid.
  225.  
  226.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::iiiinnnniiiittttGGGGMMMM (((()))) [[[[vvvviiiirrrrttttuuuuaaaallll pppprrrrooootttteeeecccctttteeeedddd]]]]
  227.       Initializes this grid.
  228.  
  229.       Reimplemented    from QLayout.
  230.  
  231.      QQQQCCCChhhhaaaaiiiinnnn **** QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::mmmmaaaaiiiinnnnHHHHoooorrrriiiizzzzoooonnnnttttaaaallllCCCChhhhaaaaiiiinnnn (((()))) [[[[vvvviiiirrrrttttuuuuaaaallll pppprrrrooootttteeeecccctttteeeedddd]]]]
  232.       This function    returns    the main horizontal chain.
  233.  
  234.       Reimplemented    from QLayout.
  235.  
  236.      QQQQCCCChhhhaaaaiiiinnnn **** QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::mmmmaaaaiiiinnnnVVVVeeeerrrrttttiiiiccccaaaallllCCCChhhhaaaaiiiinnnn (((())))    [[[[vvvviiiirrrrttttuuuuaaaallll pppprrrrooootttteeeecccctttteeeedddd]]]]
  237.       This function    returns    the main vertical chain.
  238.  
  239.       Reimplemented    from QLayout.
  240.  
  241.      iiiinnnntttt QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::nnnnuuuummmmCCCCoooollllssss (((()))) ccccoooonnnnsssstttt
  242.       Returns the number of    columns    in this    grid.
  243.  
  244.      iiiinnnntttt QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::nnnnuuuummmmRRRRoooowwwwssss (((()))) ccccoooonnnnsssstttt
  245.       Returns the number of    rows in    this grid.
  246.  
  247.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::sssseeeettttCCCCoooollllSSSSttttrrrreeeettttcccchhhh (((( iiiinnnntttt ccccoooollll,,,,    iiiinnnntttt ssssttttrrrreeeettttcccchhhh ))))
  248.       Sets the stretch factor of column _c_o_l    to _s_t_r_e_t_c_h. The    first
  249.       column is number 0.
  250.  
  251.       The stretch factor is    relative to the    other columns in this
  252.       grid.    Columns    with higher stretch factor take    more of    the
  253.       available space.
  254.  
  255.       The default stretch factor is    0. If the stretch factor is 0
  256.       and no other column in this table can    grow at    all, the
  257.       column may still grow.
  258.  
  259.  
  260.  
  261.      Page 4                         (printed 9/22/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))   QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt((((3333qqqqtttt))))
  269.  
  270.  
  271.  
  272.       Examples:  pref/pref.cpp layout/layout.cpp
  273.       widgets/widgets.cpp
  274.  
  275.      vvvvooooiiiidddd QQQQGGGGrrrriiiiddddLLLLaaaayyyyoooouuuutttt::::::::sssseeeettttRRRRoooowwwwSSSSttttrrrreeeettttcccchhhh (((( iiiinnnntttt rrrroooowwww,,,,    iiiinnnntttt ssssttttrrrreeeettttcccchhhh ))))
  276.       Sets the stretch factor of row _r_o_w to    _s_t_r_e_t_c_h. The first row
  277.       is number 0.
  278.  
  279.       The stretch factor is    relative to the    other rows in this
  280.       grid.    Rows with higher stretch factor    take more of the
  281.       available space.
  282.  
  283.       The default stretch factor is    0. If the stretch factor is 0
  284.       and no other row in this table can grow at all, the row may
  285.       still    grow.
  286.  
  287.       Examples:  widgets/widgets.cpp
  288.  
  289.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  290.       hhhhttttttttpppp::::////////wwwwwwwwwwww....ttttrrrroooollllllll....nnnnoooo////qqqqtttt////qqqqggggrrrriiiiddddllllaaaayyyyoooouuuutttt....hhhhttttmmmmllll
  291.  
  292.      CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
  293.       Copyright 1992-1997 Troll Tech AS.  See the LICENSE file
  294.       included in the distribution for a complete license
  295.       statement.
  296.  
  297.      AAAAUUUUTTTTHHHHOOOORRRR
  298.       Generated automatically from the source code.
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                         (printed 9/22/98)
  328.  
  329.  
  330.  
  331.